<html>
<body>

<?php

//While loop

$i=1;
while($i<=5)
  {
  echo "The number is " . $i . "<br />";
  $i++;
  }

?>

//do while loop

<?php
$i=1;
do
  {
  $i++;
  echo "The number is " . $i . "<br />";
  }
while ($i<=5);
?>

//for loop


<?php
for ($i=1; $i<=5; $i++)
  {
  echo "The number is " . $i . "<br />";
  }
?>

//foreach loop

<?php
$x=array("one","two","three");
foreach ($x as $value)
  {
  echo $value . "<br />";
  }
?>


</body>
</html>